Run Entities
These entities are used by the Run adapter and encapsulate data objects used by the Epicenter Run API.
Enums
MORPHOLOGY
Denotes the type of run.
Possible values:
MORPHOLOGY.MANY = 'MANY'- A regular model run with a randomly generated unique key.MORPHOLOGY.SINGULAR = 'SINGULAR'- Denotes a singular run.MORPHOLOGY.PROXY = 'PROXY'- Denotes a singular run with an open HTTP endpoint useful for fine grained permission elevation of client calls.
Interfaces
Here’s the Markdown documentation for the V2ModelContext interface, following the same format and tone as your previous examples:
ModelContext
Contains overrides for model context values.
Properties
version(string): The model context version. Possible values:"V1""V2"
variables(Record<string, VariableOptions>, optional): The run state variables that need to be stored and their processing options.externalFunctions(Record<string, WireExternalFunction>, optional): A mapping of external function names toWireExternalFunctionobjects, allowing integration with external logic or systems.modelVersion(number, optional): The numerical version identifier of the model.mappedFiles(Record<string, string>, optional): A mapping of model context files for different simulation scenarios.control(ExcelModelControl|JavaModelControl|PowersimModelControl|VensimModelControl, optional): An object with settings specific to the model language.language(string, optional): The primary programming or modeling language used for this model context.protections(Protections, optional): Protection settings for state variables.restorations(Restorations, optional): Settings defining how a model run gets restored.workerImage(string, optional): The Docker worker image.dependencies(AptExternalDependency|CranExternalDependency|GitExternalDependency|JuliaExternalDependency|NpmExternalDependency|PypiExternalDependency|ShellExternalDependency, optional): A list of external dependencies for the model.operations(Record<string, OperationOptions>, optional): A mapping of operation names toOperationOptionsobjects that define how the operations are executed.defaults(ModelContextDefaults, optional): Specifies the default context settings for the model.enableStateCache(boolean, optional): Iftrue, cache the values of non-state-changing operations.redirectStandardOut(boolean, optional): Iftrue, redirects the standard output (stdout) stream to a log file.startDebugger(boolean, optional): Iftrue, starts the debugger (for languages that have a debugger).inceptionGracePeriodSeconds(number, optional): How long we should wait for the model to start. The default is 180 seconds (3 minutes).minimumLogLevel(string, optional): The minimum severity level of the log.events(Record<string, EventOptions>, optional): A mapping of event names toEventOptionsobjects that control event-handling.
ExecutionContext
Represents the execution context for a run.
Properties:
presets(Record<string, Record<string, unknown>>, optional): A mapping of variables that you want pre-set on a run.mappedFiles(Record<string, string>, optional): A mapping of context files.version: string- The version of the execution context. Possible values:"V1".tool(StellaModelTool|VensimModelTool, optional): An object containing language specific properties for the model..
ProcAction
Execute a procedure.
Properties:
name: string- The name of the procedure.arguments?: unknown[]- (Optional) Arguments passed to the procedure.objectType: 'execute'- Type identifier for the action.
GetAction
Get the value of a variable.
Properties:
name: string- The name of the item to get.objectType: 'get'- Type identifier for the action.
SetAction
Set a variable value.
Properties:
name: string- The name of the item to set.value: unknown- The value to be set.objectType: 'set'- Type identifier for the action.
Run
Represents a single run instance.
Properties:
runKey: string- Unique identifier for the run.variables?: Record<string, unknown>- (Optional) Key-value pairs of variables associated with the run.
Type aliases
Action
Defines an action type, which can be one of the following:
ProcAction- Represents an execution action.GetAction- Represents a retrieval action.SetAction- Represents a setting action.
RunCreateOptions
Defines options for creating a run.
Properties:
readLock?: keyof typeof ROLE- (Optional) Read lock level. Part of the permit for the run.writeLock?: keyof typeof ROLE- (Optional) Write lock level. Part of the permit for the run.ephemeral?: boolean- (Optional) Iftrue, the run will only exist so long as its in memory. Nothing is written to the database, history, or variables.trackingKey?: string- (Optional) A string that you can assign to a run for tracking purposes.To track the run, perform a search for thetrackingKeyvalue.modelContext?: ModelContext- (Optional) Context information for the model.executionContext?: ExecutionContext- (Optional) Context information for execution.allowChannel?: boolean- (Optional) Whether channel access is allowed.RoutingOptions- Additional routing options.
RunStrategy
Defines the strategy for handling runs.
Possible values:
'reuse-across-sessions'-- will get the most recent run for the given scope, creating it if it does not exist'reuse-never'-- will create a new run every time'reuse-by-tracking-key'- Reuse a run identified by a tracking key.'multiplayer'- Supports multiple players interacting in the run.